package com.ymatou.query.trading.api.testcase;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.json.JSONArray;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.trading.operate.parameter.PlaceOrderResp;
import com.ymatou.query.trading.api.parameter.GetBuyerOrderInfosArguments;
import com.ymatou.query.trading.api.parameter.GetBuyerOrderInfosBean;
import com.ymatou.query.trading.api.parameter.OrderConverter;
import com.ymatou.query.trading.api.parameter.OrderInfo;
import com.ymatou.query.trading.api.parameter.ProductInfo;
import com.ymatou.query.trading.api.service.GetBuyerOrderInfosV2Call;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.OrderCallService;
import com.ymttest.common.entitie.C2COrderInfo.C2COrderInfoExt;
import com.ymttest.common.entitie.C2COrderInfo.OrderProductInfos;
import com.ymttest.common.entitie.C2COrderInfo.RefundBillInfo;
import com.ymttest.common.entitie.ProductInfo.ProductInfoExt;
import com.ymttest.common.enums.OrderRefundedTypeEnum;
import com.ymttest.common.enums.OrderStatusEnum;
import com.ymttest.database.sqlwapper.DefaultWapper;
import com.ymttest.database.sqlwapper.YmtOrdersWapper;
import com.ymttest.database.sqlwapper.YmtRefundWapper;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.EnvSetup;

/**
 * 获取买家订单列表
 */
@TestSuite
@SuppressWarnings("rawtypes")
public class Ts_GetBuyerOrderInfosV2 {

	private static GetBuyerOrderInfosBean getBuyerOrderInfosBean;
	private static GetBuyerOrderInfosV2Call getBuyerOrderInfosV2Call;
	private static YmtOrdersWapper ymtOrdersWapper;
	private static List<Map> OrderInfos;
	private static List<Map> ProductInfos;
	private static List<Map> RefundBillInfos;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取买家订单列表");
	}

	@Before
	public void caseUp() {
		getBuyerOrderInfosBean = new GetBuyerOrderInfosBean();
		getBuyerOrderInfosV2Call = new GetBuyerOrderInfosV2Call();
		ymtOrdersWapper = new YmtOrdersWapper();
		OrderInfos = new ArrayList<Map>();
		ProductInfos = new ArrayList<Map>();
		RefundBillInfos = new ArrayList<Map>();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getBuyerOrderInfosV2Call.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	private void verify() throws Exception {
		DecimalFormat df = new DecimalFormat("0.00");
		List<OrderInfo> expectOrders = ConstructExpectResponse();
		JSONArray actualOrders = getBuyerOrderInfosV2Call.getOrderInfos();
		for (int i = 0; i < expectOrders.size(); i++) {
			OrderInfo expectOrder = expectOrders.get(i);
			OrderInfo actualOrder = (OrderInfo) FormatUtil.GSONToObject(
					actualOrders.get(i).toString(), OrderInfo.class);
			DataUtil.verifyEquals(expectOrder.getOrderGroupId(),
					actualOrder.getOrderGroupId(), "验证OrderGroupId");
			DataUtil.verifyEquals(expectOrder.getOrderId(),
					actualOrder.getOrderId(), "验证OrderId");
			DataUtil.verifyDateNearlyEquals(expectOrder.getAddTime(),
					actualOrder.getAddTime(), 5000l,
					"验证OrderId:" + actualOrder.getOrderId() + "的AddTime");
			DataUtil.verifyEquals(
					df.format(expectOrder.getAutoCancelOrderHours()),
					df.format(actualOrder.getAutoCancelOrderHours()),
					"验证OrderId:" + actualOrder.getOrderId()
							+ "的AutoCancelOrderHours");
			DataUtil.verifyEquals(expectOrder.getPlatform(),
					actualOrder.getPlatform(),
					"验证OrderId:" + actualOrder.getOrderId() + "的Platform");
			DataUtil.verifyEquals(expectOrder.isShangou(),
					actualOrder.isShangou(),
					"验证OrderId:" + actualOrder.getOrderId() + "的Shangou");
			DataUtil.verifyEquals(expectOrder.getCancelReason(),
					actualOrder.getCancelReason(),
					"验证OrderId:" + actualOrder.getOrderId() + "的CancelReason");
			DataUtil.verifyEquals(expectOrder.isEvaluated(),
					actualOrder.isEvaluated(),
					"验证OrderId:" + actualOrder.getOrderId() + "的Evaluated");
			if (expectOrder.getStatus() == null) {
				DataUtil.verifyEquals(expectOrder.getStatus(),
						actualOrder.getStatus(),
						"验证OrderId:" + actualOrder.getOrderId() + "的Status");
			} else {
				DataUtil.verifyEquals(expectOrder.getStatus()
						.getThirdPartyRefundStatus(), actualOrder.getStatus()
						.getThirdPartyRefundStatus(), "验证OrderId:"
						+ actualOrder.getOrderId()
						+ "的Status.ThirdPartyRefundStatus");
				DataUtil.verifyEquals(expectOrder.getStatus().getOrderStatus(),
						actualOrder.getStatus().getOrderStatus(), "验证OrderId:"
								+ actualOrder.getOrderId()
								+ "的Status.OrderStatus");
				DataUtil.verifyEquals(expectOrder.getStatus()
						.getSalesRefundStatus(), actualOrder.getStatus()
						.getSalesRefundStatus(),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Status.SalesRefundStatus");
			}
			if (null == expectOrder.getSeller()) {
				DataUtil.verifyEquals(expectOrder.getSeller(),
						actualOrder.getSeller(),
						"验证OrderId:" + actualOrder.getOrderId() + "的Seller");
			} else {
				DataUtil.verifyEquals(expectOrder.getSeller()
						.getSellerLoginId(), actualOrder.getSeller()
						.getSellerLoginId(),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Seller.SellerLoginId");
				DataUtil.verifyEquals(expectOrder.getSeller().getSellerNote(),
						actualOrder.getSeller().getSellerNote(), "验证OrderId:"
								+ actualOrder.getOrderId()
								+ "的Seller.SellerNote");
				DataUtil.verifyEquals(expectOrder.getSeller().getUserId(),
						actualOrder.getSeller().getUserId(), "验证OrderId:"
								+ actualOrder.getOrderId() + "的Seller.UserId");
			}
			if (null == expectOrder.getConsumer()) {
				DataUtil.verifyEquals(expectOrder.getConsumer(),
						actualOrder.getConsumer(),
						"验证OrderId:" + actualOrder.getOrderId() + "的Consumer");
			} else {
				DataUtil.verifyEquals(expectOrder.getConsumer().getUserId(),
						actualOrder.getConsumer().getUserId(), "验证OrderId:"
								+ actualOrder.getOrderId() + "的Consumer.UserId");
				DataUtil.verifyEquals(expectOrder.getConsumer()
						.isNeedUploadIDCard(), actualOrder.getConsumer()
						.isNeedUploadIDCard(),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Consumer.NeedUploadIDCard");
				DataUtil.verifyEquals(expectOrder.getConsumer()
						.isIDCardUpdated(), actualOrder.getConsumer()
						.isIDCardUpdated(),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Consumer.IDCardUpdated");
				DataUtil.verifyEquals(expectOrder.getConsumer().getLeaveWord(),
						actualOrder.getConsumer().getLeaveWord(), "验证OrderId:"
								+ actualOrder.getOrderId()
								+ "的Consumer.LeaveWord");
			}
			if (null == expectOrder.getProducts()) {
				DataUtil.verifyEquals(expectOrder.getProducts(),
						actualOrder.getProducts(),
						"验证OrderId:" + actualOrder.getOrderId() + "的Products");
			} else {
				DataUtil.verifyEquals(expectOrder.getProducts().size(),
						actualOrder.getProducts().size(), "验证OrderId:"
								+ actualOrder.getOrderId() + "的Products的个数");
				for (int j = 0; j < expectOrder.getProducts().size(); j++) {
					ProductInfo expectInfo = expectOrder.getProducts().get(j);
//					ProductInfo actualInfo = actualOrder
//							.getProducts()
//							.stream()
//							.filter(a -> a.getCatalogId().equals(
//									expectInfo.getCatalogId()))
//							.collect(Collectors.toList()).get(0);
					ProductInfo actualInfo = actualOrder
							.getProducts()
							.stream()
							.filter(a -> a.getProductId().equals(
									expectInfo.getProductId()))
							.collect(Collectors.toList()).get(0);
					DataUtil.verifyEquals(
							df.format(expectInfo.getProductOriginalPrice()),
							df.format(actualInfo.getProductOriginalPrice()),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的ProductOriginalPrice");
					DataUtil.verifyEquals(
							df.format(expectInfo.getProductSoldPrice()),
							df.format(actualInfo.getProductSoldPrice()),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的ProductSoldPrice");
					DataUtil.verifyEquals(
							expectInfo.getProductPicUrl(),
							actualInfo.getProductPicUrl(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的ProductPicUrl");
					DataUtil.verifyEquals(
							expectInfo.getProductDescription(),
							actualInfo.getProductDescription(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的ProductDescription");
					DataUtil.verifyEquals(
							expectInfo.isIsActivityProduct(),
							actualInfo.isIsActivityProduct(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的IsActivityProduct");
					DataUtil.verifyEquals(
							expectInfo.isDeliveryFromBonded(),
							actualInfo.isDeliveryFromBonded(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的DeliveryFromBonded");
					DataUtil.verifyEquals(
							expectInfo.getProductsNum(),
							actualInfo.getProductsNum(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的ProductsNum");
					DataUtil.verifyEquals(
							expectInfo.getProductId(),
							actualInfo.getProductId(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId() + "的ProductId");
					DataUtil.verifyEquals(
							expectInfo.getCatalogInfo(),
							actualInfo.getCatalogInfo(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的CatalogInfo");
					DataUtil.verifyEquals(
							expectInfo.getPriceType(),
							actualInfo.getPriceType(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId() + "的PriceType");
					DataUtil.verifyEquals(
							expectInfo.getBondedArea(),
							actualInfo.getBondedArea(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId() + "的BondedArea");
					DataUtil.verifyEquals(
							expectInfo.getLogisticsType(),
							actualInfo.getLogisticsType(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的LogisticsType");
					DataUtil.verifyEquals(
							expectInfo.getTariffType(),
							actualInfo.getTariffType(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId() + "的TariffType");
					DataUtil.verifyEquals(
							expectInfo.getProductRefundChannel(),
							actualInfo.getProductRefundChannel(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的ProductRefundChannel");
					DataUtil.verifyEquals(
							expectInfo.isProductRefund(),
							actualInfo.isProductRefund(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的ProductRefund");
					DataUtil.verifyEquals(
							expectInfo.getPackageNo(),
							actualInfo.getPackageNo(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId() + "的PackageNo");
					DataUtil.verifyEquals(
							expectInfo.getProductInfoString(),
							actualInfo.getProductInfoString(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的ProductInfoString");
					// TODO 暂时不需要
					// DataUtil.verifyEquals(0,
					// actualInfo.getSalesRefundCode(),"验证OrderId:"
					// + actualOrder.getOrderId() +
					// "Products中CatalogId:"+expectInfo.getCatalogId()+"的SalesRefundCode");
					DataUtil.verifyEquals(
							expectInfo.getSalesRefundStatus(),
							actualInfo.getSalesRefundStatus(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的SalesRefundStatus");
					DataUtil.verifyEquals(
							expectInfo.getSalesType(),
							actualInfo.getSalesType(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId() + "的SalesType");
					DataUtil.verifyEquals(
							expectInfo.isSupportRtnWithoutReason(),
							actualInfo.isSupportRtnWithoutReason(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的SupportRtnWithoutReason");
					DataUtil.verifyEquals(
							expectInfo.getFreightFree(),
							actualInfo.getFreightFree(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "Products中CatalogId:"
									+ expectInfo.getCatalogId()
									+ "的FreightFree");
				}
			}
			if (expectOrder.getConsignee() == null) {
				DataUtil.verifyEquals(expectOrder.getConsignee(),
						actualOrder.getConsignee(),
						"验证OrderId:" + actualOrder.getOrderId() + "的Consignee");
			} else {
				DataUtil.verifyEquals(expectOrder.getConsignee().getName(),
						actualOrder.getConsignee().getName(), "验证OrderId:"
								+ actualOrder.getOrderId() + "的Consignee.Name");
				DataUtil.verifyEquals(expectOrder.getConsignee().getAddress(),
						actualOrder.getConsignee().getAddress(), "验证OrderId:"
								+ actualOrder.getOrderId()
								+ "的Consignee.Address");
				DataUtil.verifyEquals(expectOrder.getConsignee().getPostcode(),
						actualOrder.getConsignee().getPostcode(), "验证OrderId:"
								+ actualOrder.getOrderId()
								+ "的Consignee.Postcode");
				DataUtil.verifyEquals(expectOrder.getConsignee().getPhone(),
						actualOrder.getConsignee().getPhone(), "验证OrderId:"
								+ actualOrder.getOrderId() + "的Consignee.Phone");
				DataUtil.verifyEquals(expectOrder.getConsignee().getTel(),
						actualOrder.getConsignee().getTel(), "验证OrderId:"
								+ actualOrder.getOrderId() + "的Consignee.Tel");
			}
			if (null == expectOrder.getPayment()) {
				DataUtil.verifyEquals(expectOrder.getPayment(),
						actualOrder.getPayment(),
						"验证OrderId:" + actualOrder.getOrderId() + "的Payment");
			} else {
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						expectOrder.getPayment().getTotalPrice()),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getTotalPrice()), "验证OrderId:"
								+ actualOrder.getOrderId()
								+ "的Payment.TotalPrice");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						expectOrder.getPayment().getFreight()),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getFreight()), "验证OrderId:"
								+ actualOrder.getOrderId() + "的Payment.Freight");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						expectOrder.getPayment().getEarnest()),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getEarnest()), "验证OrderId:"
								+ actualOrder.getOrderId() + "的Payment.Earnest");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						expectOrder.getPayment().getNeedPostpayAmount()),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getNeedPostpayAmount()),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.NeedPostpayAmount");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						expectOrder.getPayment().getGiftUsedAmountOfPostpay()),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getGiftUsedAmountOfPostpay()),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.GiftUsedAmountOfPostpay");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						expectOrder.getPayment().getUseGiftAmount()),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getUseGiftAmount()), "验证OrderId:"
								+ actualOrder.getOrderId()
								+ "的Payment.UseGiftAmount");
				DataUtil.verifyEquals(expectOrder.getPayment().isPaidInFull(),
						actualOrder.getPayment().isPaidInFull(), "验证OrderId:"
								+ actualOrder.getOrderId()
								+ "的Payment.PaidInFull");
				DataUtil.verifyEquals(expectOrder.getPayment()
						.getSellerCouponCode(), actualOrder.getPayment()
						.getSellerCouponCode(),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.SellerCouponCode");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						expectOrder.getPayment().getSellerCouponAmount()),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getSellerCouponAmount()),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.SellerCouponAmount");
				DataUtil.verifyDateNearlyEquals(expectOrder.getPayment()
						.getLastPayTime(), actualOrder.getPayment()
						.getLastPayTime(), 5000l,
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.LastPayTime");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						expectOrder.getPayment().getFirstPay()),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getFirstPay()), "验证OrderId:"
								+ actualOrder.getOrderId()
								+ "的Payment.FirstPay");
//				DataUtil.verifyEquals(expectOrder.getPayment().getCouponCode(),
//						actualOrder.getPayment().getCouponCode(), "验证OrderId:"
//								+ actualOrder.getOrderId()
//								+ "的Payment.CouponCode");
//				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
//						expectOrder.getPayment().getCouponValue()),
//						DataUtil.BigDecimall.format(df, actualOrder
//								.getPayment().getCouponValue()), "验证OrderId:"
//								+ actualOrder.getOrderId()
//								+ "的Payment.CouponValue");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						expectOrder.getPayment().getPostPaidAmountOfGift()),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getPostPaidAmountOfGift()),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.PostPaidAmountOfGift");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						expectOrder.getPayment().getRealPostPay()),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getRealPostPay()), "验证OrderId:"
								+ actualOrder.getOrderId()
								+ "的Payment.RealPostPay");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						expectOrder.getPayment().getRealPay()),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getRealPay()), "验证OrderId:"
								+ actualOrder.getOrderId() + "的Payment.RealPay");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						DataUtil.BigDecimall.GetValueOrDefault(expectOrder
								.getPayment().getOriginalPostpayAmount())),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getOriginalPostpayAmount()),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.OriginalPostpayAmount");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						expectOrder.getPayment().getActualPostpayAmount()),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getActualPostpayAmount()),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.ActualPostpayAmount");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						DataUtil.BigDecimall.GetValueOrDefault(expectOrder
								.getPayment().getExpectedPostpayAmount())),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getExpectedPostpayAmount()),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.ExpectedPostpayAmount");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						DataUtil.BigDecimall.GetValueOrDefault(expectOrder
								.getPayment().getExpectedPayAmount())),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getExpectedPayAmount()),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.ExpectedPayAmount");
				DataUtil.verifyEquals(expectOrder.getPayment().getTradingId(),
						actualOrder.getPayment().getTradingId(), "验证OrderId:"
								+ actualOrder.getOrderId()
								+ "的Payment.TradingId");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						DataUtil.BigDecimall.GetValueOrDefault(expectOrder
								.getPayment().getSalesRefundAmount())),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getSalesRefundAmount()),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.SalesRefundAmount");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						DataUtil.BigDecimall.GetValueOrDefault(expectOrder
								.getPayment().getTotalPriceChange())),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getTotalPriceChange()),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.TotalPriceChange");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						DataUtil.BigDecimall.GetValueOrDefault(expectOrder
								.getPayment().getPostpayPriceChange())),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getPostpayPriceChange()),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.PostpayPriceChange");
				DataUtil.verifyEquals(expectOrder.getPayment()
						.isOnlyNeedPayOnce(), actualOrder.getPayment()
						.isOnlyNeedPayOnce(),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.OnlyNeedPayOnce");
				DataUtil.verifyEquals(DataUtil.BigDecimall.format(df,
						DataUtil.BigDecimall.GetValueOrDefault(expectOrder
								.getPayment().getPromotionReducedAmount())),
						DataUtil.BigDecimall.format(df, actualOrder
								.getPayment().getPromotionReducedAmount()),
						"验证OrderId:" + actualOrder.getOrderId()
								+ "的Payment.PromotionReducedAmount");
				if (expectOrder.getPayment().getDetail() == null) {
					DataUtil.verifyEquals(expectOrder.getPayment().getDetail(),
							actualOrder.getPayment().getDetail(), "验证OrderId:"
									+ actualOrder.getOrderId()
									+ "的Payment.Detail");
				} else {
					// TODO
				}
				if (expectOrder.getTransfer() == null) {
					DataUtil.verifyEquals(expectOrder.getTransfer(),
							actualOrder.getTransfer(), "验证OrderId:"
									+ actualOrder.getOrderId() + "的Transfer");
				} else {
					DataUtil.verifyEquals(expectOrder.getTransfer()
							.isSupportLocalRefund(), actualOrder.getTransfer()
							.isSupportLocalRefund(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "的Transfer.SupportLocalRefund");
					DataUtil.verifyDateEquals(expectOrder.getTransfer()
							.getLocalRefundApplyTime(), actualOrder
							.getTransfer().getLocalRefundApplyTime(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "的Transfer.LocalRefundApplyTime");
					DataUtil.verifyDateEquals(expectOrder.getTransfer()
							.getReceiptConfirmedTime(), actualOrder
							.getTransfer().getReceiptConfirmedTime(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "的Transfer.ReceiptConfirmedTime");
					DataUtil.verifyDateEquals(expectOrder.getTransfer()
							.getAutoReceiveTime(), actualOrder.getTransfer()
							.getAutoReceiveTime(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "的Transfer.AutoReceiveTime");
					DataUtil.verifyEquals(expectOrder.getTransfer()
							.isIsDelayAutoReceiveTime(), actualOrder
							.getTransfer().isIsDelayAutoReceiveTime(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "的Transfer.IsDelayAutoReceiveTime");
					DataUtil.verifyEquals(expectOrder.getTransfer()
							.isDelayReceiveFrozened(), actualOrder
							.getTransfer().isDelayReceiveFrozened(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "的Transfer.DelayReceiveFrozened");
					DataUtil.verifyDateEquals(expectOrder.getTransfer()
							.getDelayReceiveFrozenTime(), actualOrder
							.getTransfer().getDelayReceiveFrozenTime(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "的Transfer.DelayReceiveFrozenTime");
					DataUtil.verifyEquals(expectOrder.getTransfer()
							.getSalesRefundCode(), actualOrder.getTransfer()
							.getSalesRefundCode(),
							"验证OrderId:" + actualOrder.getOrderId()
									+ "的Transfer.SalesRefundCode");
				}
				if (expectOrder.getOperation() == null) {
					DataUtil.verifyEquals(expectOrder.getOperation(),
							actualOrder.getOperation(), "验证OrderId:"
									+ actualOrder.getOperation() + "的Transfer");
				} else {
					DataUtil.verifyEquals(expectOrder.getOperation().getType(),
							actualOrder.getOperation().getType(), "验证OrderId:"
									+ actualOrder.getOrderId()
									+ "的Operation.Type");
					// DataUtil.verifyEquals(expectOrder.getOperation().isActive(),
					// actualOrder.getOperation().isActive(), "验证OrderId:"
					// + actualOrder.getOrderId()
					// + "的Operation.Active");

					// DataUtil.verifyEquals(expectOrder.getOperation().getInterval(),
					// actualOrder.getOperation().getInterval(), "验证OrderId:"
					// + actualOrder.getOrderId()
					// + "的Operation.Interval");
					// DataUtil.verifyEquals(expectOrder.getOperation()
					// .isNeedReason(), actualOrder.getOperation()
					// .isNeedReason(),
					// "验证OrderId:" + actualOrder.getOrderId()
					// + "的Operation.NeedReason");

				}
			}
		}
	}

	private List<OrderInfo> ConstructExpectResponse() {
		GetBuyerOrderInfosArguments args = new GetBuyerOrderInfosArguments();
		setArguments(args);
		args.RefundedOrderOnly = getBuyerOrderInfosBean.getRefundedOrderOnly() == null ? 0
				: getBuyerOrderInfosBean.getRefundedOrderOnly();
		if (getBuyerOrderInfosBean.getToBeEvaluatedDays() > 0) {
			args.ToBeEvaluatedDays = getBuyerOrderInfosBean
					.getToBeEvaluatedDays();
		}
		boolean group = false;
		OrderProductInfos result = Execute(args,
				getBuyerOrderInfosBean.getLastOrderIdIsRealOrderId(), group);
		List<OrderInfo> expectOrderInfos = OrderConverter.AsOrderInfos(result,
				false);
		return expectOrderInfos;
	}

	/**
	 * C# 代码中的AppSQLs.GetBuyerOrderInfos
	 * 
	 * @param args
	 * @param lastOrderIdIsRealOrderId
	 * @return
	 */
	// private OrderProductInfos Execute(GetBuyerOrderInfosArguments args,
	// boolean lastOrderIdIsRealOrderId) {
	// boolean exsitsShippedStatus = false;
	// boolean exsitsReceivedStatus = false;
	// boolean considerShippedStatus = false;
	// boolean considerReceivedStatus = false;
	// boolean considerRestStatus = true;
	//
	// List<Integer> tempOrderStatusList = new ArrayList<Integer>();
	// if (null != args.OrderStatusList) {
	// tempOrderStatusList.addAll(args.OrderStatusList);
	// }
	//
	// if (tempOrderStatusList.contains(OrderStatusEnum.Shipped.getValue())) {
	// exsitsShippedStatus = true;
	// }
	// if (tempOrderStatusList.contains(OrderStatusEnum.Received.getValue())) {
	// exsitsReceivedStatus = true;
	// }
	// if (!(exsitsShippedStatus && exsitsReceivedStatus)) {
	// if (exsitsShippedStatus) {
	// tempOrderStatusList.removeIf(a -> a == OrderStatusEnum.Shipped
	// .getValue());
	// considerShippedStatus = true;
	// considerRestStatus = tempOrderStatusList.size() > 0 ? true
	// : false;
	// }
	// if (exsitsReceivedStatus) {
	// tempOrderStatusList.removeIf(a -> a == OrderStatusEnum.Received
	// .getValue());
	// considerReceivedStatus = true;
	// considerRestStatus = tempOrderStatusList.size() > 0 ? true
	// : false;
	// }
	// }
	//
	// String evaluatedDateBase = null;
	// if (null != args.ToBeEvaluatedDays) {
	// evaluatedDateBase = " (getdate() - " + args.ToBeEvaluatedDays
	// + ") ";
	// }
	//
	// int maxCount = args.OrderNum * 10;
	// int orderGroupId = 0;
	// List<Map> orderGroups = null;
	//
	// if (DataUtil.Integerr.GetValueOrDefault(args.LastOrderId) != 0) {
	// if (lastOrderIdIsRealOrderId) {
	// orderGroupId = (int) ymtOrdersWapper
	// .selectOrders2("iMainOrderId", null,
	// "iOrderId =" + args.LastOrderId).get(0)
	// .get("iMainOrderId");
	// } else {
	// orderGroupId = args.LastOrderId;
	// }
	// }
	// String queryField1 = " top "
	// + maxCount
	// +
	// " o.iMainOrderId as [groupId], o.iOrderId as [id], o.iSalesRefundStatus as [refund]";
	// String joinCondition1 =
	// " join Ymt_OrderExt(nolock) e on o.iOrderId = e.iOrderId left join Temp_ReceivedOrders20151109(nolock) r on o.iOrderId = r.iOrderId ";
	// StringBuffer queryCondition1 = new StringBuffer();
	// queryCondition1.append(" o.iUserId = " + args.UserId);
	// if (args.OrderStatusUsingMethod != 0) { //
	// OrderStatusUsingMethod可能值为0/1/2/3
	// if (args.OrderStatusUsingMethod == 1) {
	// queryCondition1
	// .append(" and o.iTradingStatus=17 and o.bPaidInFull=1");
	// } else if (args.OrderStatusUsingMethod == 2) {
	// queryCondition1
	// .append(" and o.iTradingStatus=17 and o.bPaidInFull=0");
	// } else {
	// boolean needAddAnd = true;
	// if (considerShippedStatus || considerReceivedStatus
	// || considerRestStatus) {
	// queryCondition1.append("(");
	// }
	// if (considerShippedStatus) {
	// queryCondition1
	// .append("  and o.iTradingStatus = 3 or o.iTradingStatus = 4 and r.iProcessStatus = 0");
	// needAddAnd = false;
	// }
	// if (considerReceivedStatus) {
	// if (needAddAnd) {
	// queryCondition1.append(" and");
	// } else {
	// queryCondition1.append(" or");
	// }
	// queryCondition1
	// .append("  o.iTradingStatus = 4 and (r.iProcessStatus is null or r.iProcessStatus > 0)");
	// needAddAnd = false;
	// }
	// if (considerRestStatus) {
	// if (needAddAnd) {
	// queryCondition1.append(" and");
	// } else {
	// queryCondition1.append(" or");
	// }
	// queryCondition1.append("  o.iTradingStatus in "
	// + DataUtil.toInOfSql(tempOrderStatusList));
	// needAddAnd = false;
	// }
	// if (considerShippedStatus || considerReceivedStatus
	// || considerRestStatus) {
	// queryCondition1.append("(");
	// }
	// }
	// }
	// if (orderGroupId != 0) {
	// queryCondition1.append(" and o.iMainOrderId < " + orderGroupId);
	// }
	// if (args.RefundedOrderOnly != 0) {
	// if (args.RefundedOrderOnly == 1) {
	// queryCondition1
	// .append(" and o.dApplyLocalReturnTime is not null");
	// }
	// if (args.RefundedOrderOnly == 2) {
	// queryCondition1.append(" and o.iSalesRefundStatus is not null");
	// }
	// }
	// if (evaluatedDateBase != null) {
	// queryCondition1
	// .append(" and o.iTradingStatus = 4 and isnull(o.bEvaluated, 0) = 0 and o.dConfirmedTime >= '"
	// + evaluatedDateBase + "'");
	// }
	// queryCondition1
	// .append(" and o.bDeleted is null order by o.iMainOrderId desc");
	// orderGroups = ymtOrdersWapper.selectOrders2(queryField1,
	// joinCondition1, queryCondition1.toString());
	//
	// List<Integer> orderIds = new ArrayList<Integer>();
	// List<Integer> topMainOrderIds = new ArrayList<Integer>();
	// // 根据groupId倒序排序
	// List<Map> list1 = (List<Map>) orderGroups
	// .stream()
	// .sorted((a, b) -> (int) b.get("groupId")
	// - (int) a.get("groupId")).collect(Collectors.toList());
	// // 提取groupId列存储到list中
	// List<Integer> list2 = new ArrayList<Integer>();
	// // 去重
	// list1.forEach(a -> list2.add((int) a.get("groupId")));
	// List<Integer> allMainOrderIds = (List<Integer>) list2.stream()
	// .distinct().collect(Collectors.toList());
	// // 获取top orderNum的主单号
	// if (allMainOrderIds.size() < args.OrderNum) {
	// topMainOrderIds = allMainOrderIds;
	// } else {
	// for (int i = 0; i < args.OrderNum; i++) {
	// topMainOrderIds.add(allMainOrderIds.get(i));
	// }
	// }
	// for (Map orderGroup : orderGroups) {
	// if (topMainOrderIds.contains(orderGroup.get("groupId"))) {
	// orderIds.add((int) orderGroup.get("id"));
	// }
	// }

	/**
	 * 对应存储过程sp_trd_GetAppBuyerOrders_Group2
	 * 
	 * @param args
	 * @param lastOrderIdIsRealOrderId
	 * @return
	 */
	private OrderProductInfos Execute(GetBuyerOrderInfosArguments args,
			boolean lastOrderIdIsRealOrderId, boolean group) {
		boolean exsitsShippedStatus = false;
		boolean exsitsReceivedStatus = false;
		boolean considerShippedStatus = false;
		boolean considerReceivedStatus = false;
		boolean considerRestStatus = true;

		List<Integer> tempOrderStatusList = new ArrayList<Integer>();
		if (null != args.OrderStatusList) {
			tempOrderStatusList.addAll(args.OrderStatusList);
		}

		if (tempOrderStatusList.contains(OrderStatusEnum.Shipped.getValue())) {
			exsitsShippedStatus = true;
		}
		if (tempOrderStatusList.contains(OrderStatusEnum.Received.getValue())) {
			exsitsReceivedStatus = true;
		}
		if (!(exsitsShippedStatus && exsitsReceivedStatus)) {
			if (exsitsShippedStatus) {
				tempOrderStatusList.removeIf(a -> a == OrderStatusEnum.Shipped
						.getValue());
				considerShippedStatus = true;
				considerRestStatus = tempOrderStatusList.size() > 0 ? true
						: false;
			}
			if (exsitsReceivedStatus) {
				tempOrderStatusList.removeIf(a -> a == OrderStatusEnum.Received
						.getValue());
				considerReceivedStatus = true;
				considerRestStatus = tempOrderStatusList.size() > 0 ? true
						: false;
			}
		}

		String evaluatedDateBase = null;
		if (null != args.ToBeEvaluatedDays) {
			evaluatedDateBase = " (getdate() - " + args.ToBeEvaluatedDays
					+ ") ";
		}

		int maxCount = args.OrderNum * 10;
		int orderGroupId = 0;
		List<Map> orderGroups = null;

		if (DataUtil.Integerr.GetValueOrDefault(args.LastOrderId) != 0) {
			if (lastOrderIdIsRealOrderId) {
				orderGroupId = (int) ymtOrdersWapper
						.selectOrders2("iMainOrderId", null,
								"iOrderId =" + args.LastOrderId).get(0)
						.get("iMainOrderId");
			} else {
				orderGroupId = args.LastOrderId;
			}
		}
		String queryField1 = " top "
				+ maxCount
				+ " o.iMainOrderId as [groupId], o.iOrderId as [id], o.iSalesRefundStatus as [refund]";
		String joinCondition1 = " join Ymt_OrderExt(nolock) e on o.iOrderId = e.iOrderId left join Temp_ReceivedOrders20151109(nolock) r on o.iOrderId = r.iOrderId ";
		StringBuffer queryCondition1 = new StringBuffer();
		queryCondition1.append(" o.iUserId = " + args.UserId);
		if (args.OrderStatusUsingMethod != 0) { // OrderStatusUsingMethod可能值为0/1/2/3
			boolean needAddOr = false;
			boolean addAnd = true;
			if (args.OrderStatusUsingMethod == 1
					|| args.OrderStatusUsingMethod == 2
					|| considerShippedStatus || considerReceivedStatus
					|| considerRestStatus) {
				queryCondition1.append(" and (");
				if (args.OrderStatusUsingMethod == 1) {
					queryCondition1
							.append("o.iTradingStatus=17 and o.bPaidInFull=1");
					needAddOr = true;
				} else if (args.OrderStatusUsingMethod == 2) {
					queryCondition1
							.append("o.iTradingStatus=17 and o.bPaidInFull=0");
					needAddOr = true;
				}
				if (considerShippedStatus || considerReceivedStatus
						|| considerRestStatus) {
					if (considerShippedStatus) {
						if (needAddOr) {
							queryCondition1.append(" or (");
						}
						queryCondition1
								.append("  o.iTradingStatus = 3 or o.iTradingStatus = 4 and r.iProcessStatus = 0");
						if (needAddOr) {
							queryCondition1.append(")");
						}
						needAddOr = true;
					}
					if (considerReceivedStatus) {
						if (needAddOr) {
							queryCondition1.append(" or (");
						}
						queryCondition1
								.append("  o.iTradingStatus = 4 and (r.iProcessStatus is null or r.iProcessStatus > 0)");
						if (needAddOr) {
							queryCondition1.append(")");
						}
						needAddOr = true;
					}
					if (considerRestStatus) {
						if (needAddOr) {
							queryCondition1.append(" or (");
						}
						queryCondition1.append("  o.iTradingStatus in "
								+ DataUtil.toInOfSql(tempOrderStatusList));
						if (needAddOr) {
							queryCondition1.append(")");
						}
					}
				}
				queryCondition1.append(")");
			}
		}
		if (orderGroupId != 0) {
			queryCondition1.append(" and o.iMainOrderId < " + orderGroupId);
		}
		if (args.RefundedOrderOnly != 0) {
			if (args.RefundedOrderOnly == 1) {
				queryCondition1
						.append(" and o.dApplyLocalReturnTime is not null");
			}
			if (args.RefundedOrderOnly == 2) {
				queryCondition1.append(" and o.iSalesRefundStatus is not null");
			}
		}
		if (evaluatedDateBase != null) {
			queryCondition1
					.append(" and o.iTradingStatus = 4 and isnull(o.bEvaluated, 0) = 0 and o.dConfirmedTime > '"
							+ evaluatedDateBase + "'");
		}
		queryCondition1.append(" and o.bDeleted is null");
		queryCondition1.append(" order by o.iMainOrderId desc");
		orderGroups = ymtOrdersWapper.selectOrders2(queryField1,
				joinCondition1, queryCondition1.toString());

		List<Integer> orderIds = new ArrayList<Integer>();
		List<Integer> topMainOrderIds = new ArrayList<Integer>();
		// 根据groupId倒序排序
		List<Map> list1 = (List<Map>) orderGroups
				.stream()
				.sorted((a, b) -> (int) b.get("groupId")
						- (int) a.get("groupId")).collect(Collectors.toList());
		// 提取groupId列存储到list中
		List<Integer> list2 = new ArrayList<Integer>();
		// 去重
		list1.forEach(a -> list2.add((int) a.get("groupId")));
		List<Integer> allMainOrderIds = (List<Integer>) list2.stream()
				.distinct().collect(Collectors.toList());
		// 获取top orderNum的主单号
		if (allMainOrderIds.size() < args.OrderNum) {
			topMainOrderIds = allMainOrderIds;
		} else {
			for (int i = 0; i < args.OrderNum; i++) {
				topMainOrderIds.add(allMainOrderIds.get(i));
			}
		}
		for (Map orderGroup : orderGroups) {
			if (topMainOrderIds.contains(orderGroup.get("groupId"))) {
				orderIds.add((int) orderGroup.get("id"));
			}
		}

		String queryField2 = "o.iMainOrderId,o.iOrderId,o.iTradingId,o.iUserId,o.sBuyerLoginId,"
				+ "o.dAddTime,o.fOrderPrice,o.fOrderDiscount,o.fAutoCancelOrderHours,bEvaluated,"
				+ "case when r.iProcessStatus is null then o.iTradingStatus "
				+ "when r.iProcessStatus = 0 then 3 else o.iTradingStatus end as iTradingStatus,"
				+ "o.fUseGiftAmount,o.sLeaveWord,o.iBuyerId,o.dDispathTime,o.bPaidInFull,o.fFreight,o.dConfirmedTime,"
				+ "o.sReceivePerson,o.sAddress,o.sPostCode,o.sPhone,o.sTelephone,"
				+ "o.bCanLocalReturn,o.dApplyLocalReturnTime, o.fTotalPrice,e.bIsNeedUploadIdCard,"
				+ "e.sOrderSource,e.iOrderType,o.bShangouOrder,o.iThirdPartyRefundStatus ,o.sSellerLoginId,"
				+ "o.CouponValue,o.iCouponChannel,o.sCouponCode,o.sYmtCouponCode,o.sSellerCouponCode,"
				+ "o.fYmtCouponAmount,o.fSellerCouponAmount,e.bHaveUploadedIdCard,frozen.dFrozenTime,"
				+ "frozen.iUserId as iFrozenUserId,frozen.bFrozen,frozen.bFrozenAutoReceive,frozen.bPause,"
				+ "(select top 1 concat(p.fAmount,'|',p.fUseGiftAmount) from Ymt_OrderPostPay(nolock) p "
				+ "where p.iOrderId = o.iOrderId and (p.iAction = 0 or p.iAction = 1) order by p.iAction desc) "
				+ "postpayAccountAndGiftInfo,s.*,o.iSalesRefundStatus,o.dPaidTime,o.dAcceptTime,o.dPostPaidTime,"
				+ "(select top 1 [sId] from Ymt_IdPic(nolock) c where o.iUserId = c.iUserId and o.sReceivePerson = c.sName "
				+ "and e.bIsNeedUploadIdCard = 1) as IdCardUploadedKey,r.iProcessStatus,o.fSellerPromotionAmount";
		StringBuffer joinCondition2 = new StringBuffer();
		joinCondition2
				.append(" left join Ymt_OrderExt(nolock) e on o.iOrderId = e.iOrderId");
		joinCondition2
				.append(" left join Ymt_Order_Frozen(nolock) frozen on frozen.iOrderId = o.iOrderId");
		joinCondition2
				.append(" left join Ymt_OrderState(nolock) s on o.iOrderId = s.iOrderId");
		joinCondition2
				.append(" left join Temp_ReceivedOrders20151109(nolock) r on o.iOrderId = r.iOrderId");

		StringBuffer queryCondition2 = new StringBuffer();
		queryCondition2
				.append(" o.iOrderId in " + DataUtil.toInOfSql(orderIds));
		queryCondition2
				.append(" order by o.iMainOrderId desc, o.sSellerCouponCode desc");
		OrderInfos = ymtOrdersWapper.selectOrders2(queryField2,
				joinCondition2.toString(), queryCondition2.toString());
		if (OrderInfos.size() > 0) {
			String queryField3 = "oi.iOrderId,oi.iAmount,oi.sProductId,oi.sPropertyInfo,oi.sCatalogId,"
					+ "oi.iCatalogStatus,oi.iPriceType,oi.sTitle,oi.sPictureUrl,oi.fOriginalPrice,oi.iBondedArea,"
					+ "oi.iTariffType,oi.iProductRefundChannel,oi.iProductRefundStatus,oi.sPackageNo,"
					+ "oi.sProductInfo,oi.fYmtCouponAmount,oi.fSellerCouponAmount,oi.iSalesType,"
					+ "oi.fProductPrice,oi.fProductOriginalPrice,ie.iActivityId,oi.fSellerPromotionAmount, "
					+ "oi.bSupportRtnWithoutReason, oi.bFreightFree,sp.PromotionId,sp.PromotionName,"
					+ "sp.PromotionType,sp.MatchCondition,sp.PromotionValue,sp.ReducedAmount";
			String joinCondition3 = "left join Ymt_OrderInfoExt(nolock) ie on oi.sOrderInfoId = ie.sOrderInfoId"
					+ " left join Ymt_SellerPromotion(nolock) sp on sp.OrderInfoId = oi.sOrderInfoId";
			String queryCondition3 = "oi.iOrderId in "
					+ DataUtil.toInOfSql(orderIds);
			ProductInfos = new DefaultWapper().selectOrderInfo(queryField3,
					joinCondition3, queryCondition3);

			RefundBillInfos = new YmtRefundWapper().selectRefundBill2(null,
					null, "rb.OrderId in " + DataUtil.toInOfSql(orderIds));
		}
		return Convert();
	}

	private OrderProductInfos Convert() {
		OrderProductInfos orderProductInfos = new OrderProductInfos();
		List<C2COrderInfoExt> orderInfos = null;
		List<ProductInfoExt> productInfos = null;
		List<RefundBillInfo> refundBillInfos = null;
		if (null != OrderInfos) {
			orderInfos = new ArrayList<C2COrderInfoExt>();
			for (int i = 0; i < OrderInfos.size(); i++) {
				C2COrderInfoExt orderInfo = new C2COrderInfoExt();
				Map map = OrderInfos.get(i);
				orderInfo.setiMainOrderId((int) map.get("iMainOrderId"));
				orderInfo.setiOrderId((int) map.get("iOrderId"));
				orderInfo.setiTradingId(DataUtil.Integerr.GetValueOrDefault(map
						.get("iTradingId")));
				orderInfo.setiUserId((int) map.get("iUserId"));
				orderInfo.setsBuyerLoginId((String) map.get("sBuyerLoginId"));
				orderInfo.setdAddTime(String.valueOf(map.get("dAddTime")));
				orderInfo.setfOrderPrice((BigDecimal) map.get("fOrderPrice"));
				orderInfo.setfOrderDiscount((BigDecimal) map
						.get("fOrderDiscount"));
				orderInfo.setfAutoCancelOrderHours((BigDecimal) map
						.get("fAutoCancelOrderHours"));
				orderInfo.setbEvaluated(DataUtil.Booleann.GetValueOrDefault(map
						.get("bEvaluated")));
				orderInfo.setiTradingStatus((int) map.get("iTradingStatus"));
				orderInfo.setfUseGiftAmount((BigDecimal) map
						.get("fUseGiftAmount"));
				orderInfo.setsLeaveWord((String) map.get("sLeaveWord"));
				orderInfo.setiBuyerId((int) map.get("iBuyerId"));
				orderInfo.setdDispathTime(String.valueOf(map
						.get("dDispathTime")));
				orderInfo.setbPaidInFull((boolean) map.get("bPaidInFull"));
				orderInfo.setfFreight((BigDecimal) map.get("fFreight"));
				orderInfo.setdConfirmedTime(String.valueOf(map
						.get("dConfirmedTime")));
				orderInfo.setsReceivePerson((String) map.get("sReceivePerson"));
				orderInfo.setsAddress((String) map.get("sAddress"));
				orderInfo.setsPostCode((String) map.get("sPostCode"));
				orderInfo.setsPhone((String) map.get("sPhone"));
				orderInfo.setsTelephone((String) map.get("sTelephone"));
				orderInfo.setbCanLocalReturn((boolean) map
						.get("bCanLocalReturn"));
				orderInfo.setdApplyLocalReturnTime((String) map
						.get("dApplyLocalReturnTime"));
				orderInfo.setfTotalPrice((BigDecimal) map.get("fTotalPrice"));
				orderInfo.setbIsNeedUploadIdCard((boolean) map
						.get("bIsNeedUploadIdCard"));
				orderInfo.setsOrderSource((String) map.get("sOrderSource"));
				orderInfo.setiOrderType((int) map.get("iOrderType"));
				orderInfo.setbShangouOrder((boolean) map.get("bShangouOrder"));
				orderInfo.setiThirdPartyRefundStatus((Integer) map
						.get("iThirdPartyRefundStatus"));
				orderInfo.setsSellerLoginId((String) map.get("sSellerLoginId"));
				orderInfo.setCouponValue((BigDecimal) map.get("CouponValue"));
				orderInfo.setiCouponChannel(DataUtil.Integerr
						.GetValueOrDefault(map.get("iCouponChannel")));
				orderInfo.setsCouponCode((String) map.get("sCouponCode"));
				orderInfo.setsYmtCouponCode((String) map.get("sYmtCouponCode"));
				orderInfo.setsSellerCouponCode((String) map
						.get("sSellerCouponCode"));
				orderInfo.setfYmtCouponAmount((BigDecimal) map
						.get("fYmtCouponAmount"));
				orderInfo.setfSellerCouponAmount((BigDecimal) map
						.get("fSellerCouponAmount"));
				orderInfo.setbHaveUploadedIdCard(DataUtil.Booleann
						.GetValueOrDefault(map.get("bHaveUploadedIdCard")));
				orderInfo
						.setdFrozenTime(String.valueOf(map.get("dFrozenTime")));
				orderInfo.setiFrozenUserId((Integer) map.get("iFrozenUserId"));
				orderInfo.setbFrozen(DataUtil.Booleann.GetValueOrDefault(map
						.get("bFrozen")));
				orderInfo.setbFrozenAutoReceive(DataUtil.Booleann
						.GetValueOrDefault(map.get("bFrozenAutoReceive")));
				orderInfo.setbPause(DataUtil.Booleann.GetValueOrDefault(map
						.get("bPause")));
				orderInfo.setPostpayAccountAndGiftInfo((String) map
						.get("postpayAccountAndGiftInfo"));
				orderInfo.setiOrderId((int) map.get("iOrderId"));
				orderInfo.setfRefundedAmountOfCash((BigDecimal) map
						.get("fRefundedAmountOfCash"));
				orderInfo.setfRefundedAmountOfGift((BigDecimal) map
						.get("fRefundedAmountOfGift"));
				orderInfo.setfPaidAmountOfCash((BigDecimal) map
						.get("fPaidAmountOfCash"));
				orderInfo.setfPaidAmountOfGift((BigDecimal) map
						.get("fPaidAmountOfGift"));
				orderInfo.setfPostPaidAmountOfCash((BigDecimal) map
						.get("fPostPaidAmountOfCash"));
				orderInfo.setfPostPaidAmountOfGift((BigDecimal) map
						.get("fPostPaidAmountOfGift"));
				orderInfo.setfPaidAmountOfCoupon((BigDecimal) map
						.get("fPaidAmountOfCoupon"));
				orderInfo.setfRefundedAmountOfCoupon((BigDecimal) map
						.get("fRefundedAmountOfCoupon"));
				orderInfo.setfPostPadiAmountOfCoupon((BigDecimal) map
						.get("fPostPadiAmountOfCoupon"));
				orderInfo.setfQuickTurnoverAmount((BigDecimal) map
						.get("fQuickTurnoverAmount"));
				orderInfo.setfCommissionFee((BigDecimal) map
						.get("fCommissionFee"));
				orderInfo.setfNeedCommissionFee((BigDecimal) map
						.get("fNeedCommissionFee"));
				orderInfo.setfPaidAmountOfFreeCard((BigDecimal) map
						.get("fPaidAmountOfFreeCard"));
				orderInfo.setfPaidAmountOfSellerCoupon((BigDecimal) map
						.get("fPaidAmountOfSellerCoupon"));
				orderInfo.setfPaidAmountOfYmtCoupon((BigDecimal) map
						.get("fPaidAmountOfYmtCoupon"));
				orderInfo.setdAddTime(String.valueOf(map.get("dAddTime")));
				orderInfo.setiSalesRefundStatus((Integer) map
						.get("iSalesRefundStatus"));
				orderInfo.setdPaidTime(String.valueOf(map.get("dPaidTime")));
				orderInfo
						.setdAcceptTime(String.valueOf(map.get("dAcceptTime")));
				orderInfo.setdPostPaidTime(String.valueOf(map
						.get("dPostPaidTime")));
				orderInfo.setIdCardUploadedKey((String) map
						.get("IdCardUploadedKey"));
				orderInfo.setfSellerPromotionAmount((BigDecimal) map
						.get("fSellerPromotionAmount"));
				orderInfos.add(orderInfo);
			}
		}
		if (null != ProductInfos) {
			productInfos = new ArrayList<ProductInfoExt>();
			for (int i = 0; i < ProductInfos.size(); i++) {
				ProductInfoExt productInfo = new ProductInfoExt();
				Map map = ProductInfos.get(i);
				productInfo.setiOrderId((int) map.get("iOrderId"));
				productInfo.setiAmount((int) map.get("iAmount"));
				productInfo.setsProductId((String) map.get("sProductId"));
				productInfo.setsPropertyInfo((String) map.get("sPropertyInfo"));
				productInfo.setsCatalogId((String) map.get("sCatalogId"));
				productInfo.setiCatalogStatus((int) map.get("iCatalogStatus"));
				productInfo.setiPriceType((int) map.get("iPriceType"));
				productInfo.setsTitle((String) map.get("sTitle"));
				productInfo.setsPictureUrl((String) map.get("sPictureUrl"));
				productInfo.setfOriginalPrice((BigDecimal) map
						.get("fOriginalPrice"));
				productInfo.setiBondedArea((Integer) map.get("iBondedArea"));
				productInfo.setiTariffType((Integer) map.get("iTariffType"));
				productInfo.setiProductRefundChannel((int) map
						.get("iProductRefundChannel"));
				productInfo.setiProductRefundStatus((Integer) map
						.get("iProductRefundStatus"));
				productInfo.setsPackageNo((String) map.get("sPackageNo"));
				productInfo.setsProductInfo((String) map.get("sProductInfo"));
//				productInfo.setfYmtCouponAmount((BigDecimal) map
//						.get("fYmtCouponAmount"));
//				productInfo.setfSellerCouponAmount((BigDecimal) map
//						.get("fSellerCouponAmount"));
				productInfo.setiSalesType((Integer) map.get("iSalesType"));
				productInfo.setfProductPrice((BigDecimal) map
						.get("fProductPrice"));
				productInfo.setfProductOriginalPrice((BigDecimal) map
						.get("fProductOriginalPrice"));
				productInfo.setiActivityId(DataUtil.Integerr
						.GetValueOrDefault(map.get("iActivityId")));
				productInfo.setfSellerPromotionAmount((BigDecimal) map
						.get("fSellerPromotionAmount"));
				productInfo
						.setbSupportRtnWithoutReason(DataUtil.Booleann
								.GetValueOrDefault(map
										.get("bSupportRtnWithoutReason")));
				productInfo.setbFreightFree((Boolean) map.get("bFreightFree"));
				productInfo.setPromotionId((Integer) map.get("PromotionId"));
				productInfo.setPromotionName((String) map.get("PromotionName"));
				productInfo
						.setPromotionType((Integer) map.get("PromotionType"));
				productInfo.setMatchCondition((String) map
						.get("MatchCondition"));
				productInfo.setPromotionValue((String) map
						.get("PromotionValue"));
				productInfo.setReducedAmount((BigDecimal) map
						.get("ReducedAmount"));
				productInfos.add(productInfo);
			}
		}
		if (null != RefundBillInfos) {
			refundBillInfos = new ArrayList<RefundBillInfo>();
			for (int i = 0; i < RefundBillInfos.size(); i++) {
				RefundBillInfo refundBillInfo = new RefundBillInfo();
				Map map = RefundBillInfos.get(i);
				refundBillInfo.setOrderId(DataUtil.Integerr
						.GetValueOrDefault(map.get("OrderId")));
				refundBillInfo
						.setRefundBillNo((String) map.get("RefundBillNo"));
				refundBillInfo.setRefundAmount((BigDecimal) map
						.get("RefundAmount"));
				refundBillInfo.setRefundType(DataUtil.Integerr
						.GetValueOrDefault(map.get("RefundType")));
				refundBillInfo.setApprover((String) map.get("Approver"));
				refundBillInfo.setAddTime(String.valueOf(map.get("AddTime")));
				refundBillInfos.add(refundBillInfo);
			}
		}
		orderProductInfos.setOrderInfos(orderInfos);
		orderProductInfos.setProductInfos(productInfos);
		orderProductInfos.setRefundBillInfos(refundBillInfos);
		return orderProductInfos;
	}

	private void setArguments(GetBuyerOrderInfosArguments args) {
		int method = GetOrderStatusUsingMethod(getBuyerOrderInfosBean
				.getOrderStatusList());
		args.UserId = getBuyerOrderInfosBean.getBuyerId();
		args.LastOrderId = DataUtil.Integerr
				.GetValueOrDefault(getBuyerOrderInfosBean.getLastOrderId());
		args.OrderNum = getBuyerOrderInfosBean.getOrderNum();
		args.OrderStatusList = getBuyerOrderInfosBean.getOrderStatusList();
		args.OrderStatusUsingMethod = method;
	}

	private int GetOrderStatusUsingMethod(List<Integer> orderStatus) {
		int orderStatusUsingMethod = 0;
		if (DataUtil.isNullOrEmpty(orderStatus) == false) {
			if (orderStatus.contains(OrderStatusEnum.SellerAccept.getValue())
					&& !orderStatus.contains(OrderStatusEnum.OrderPostPay
							.getValue())) {
				orderStatusUsingMethod = 1;
				orderStatus.removeIf(a -> a == OrderStatusEnum.SellerAccept
						.getValue());
			} else if (!orderStatus.contains(OrderStatusEnum.SellerAccept
					.getValue())
					&& orderStatus.contains(OrderStatusEnum.OrderPostPay
							.getValue())) {
				orderStatus.removeIf(a -> a == OrderStatusEnum.OrderPostPay
						.getValue());
				orderStatusUsingMethod = 2;
			} else {
				orderStatusUsingMethod = 3;
			}
		}
		return orderStatusUsingMethod;
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBuyerOrderInfosV2_001() {
		Logger.start(true, "获取买家订单列表, 参数全传(根据orderid查)，查询成功");
		try {
			int UserId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			getBuyerOrderInfosBean.setBuyerId(UserId);
			getBuyerOrderInfosBean.setOrderNum(10);
			getBuyerOrderInfosBean.setLastOrderId(0);
			getBuyerOrderInfosBean.setLastOrderIdIsRealOrderId(true);
			getBuyerOrderInfosV2Call.setData(getBuyerOrderInfosBean);
			getBuyerOrderInfosV2Call.callService();
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBuyerOrderInfosV2_002() {
		Logger.start(true, "获取买家订单列表, 只传必填字段BuyuerId,OrderNum，查询成功");
		try {
			getBuyerOrderInfosBean.setBuyerId(20238699);
			getBuyerOrderInfosBean.setOrderNum(10);
			getBuyerOrderInfosV2Call.setData(getBuyerOrderInfosBean);
			getBuyerOrderInfosV2Call.callService();
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBuyerOrderInfosV2_003() {
		Logger.start(true, "获取买家订单列表, OrderNum为必填");
		try {
			int UserId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			getBuyerOrderInfosBean.setBuyerId(UserId);
			getBuyerOrderInfosBean.setLastOrderId(112443995);
			getBuyerOrderInfosBean.setLastOrderIdIsRealOrderId(true);
			List<Integer> orderStatusList = new ArrayList<Integer>();
			orderStatusList.add(OrderStatusEnum.AccountPaid.getValue());
			orderStatusList.add(OrderStatusEnum.ApplyForPostPay.getValue());
			orderStatusList.add(OrderStatusEnum.OrderEstablish.getValue());
			orderStatusList.add(OrderStatusEnum.SystemCancel.getValue());
			orderStatusList.add(OrderStatusEnum.Shipped.getValue());
			orderStatusList.add(OrderStatusEnum.SellerAcceptCancel.getValue());
			orderStatusList.add(OrderStatusEnum.SellerAccept.getValue());
			getBuyerOrderInfosBean.setOrderStatusList(orderStatusList);
			getBuyerOrderInfosBean
					.setRefundedOrderOnly(OrderRefundedTypeEnum.SalesRefund
							.getValue());
			getBuyerOrderInfosBean.setToBeEvaluatedDays(0);
			getBuyerOrderInfosV2Call.setData(getBuyerOrderInfosBean);
			getBuyerOrderInfosV2Call.callService();
			Logger.verifyEquals("400", getBuyerOrderInfosV2Call.getCode(),
					"验证code");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBuyerOrderInfosV2_004() {
		Logger.start(true, "获取买家订单列表, BuyerId为必填");
		try {
			getBuyerOrderInfosBean.setOrderNum(10);
			getBuyerOrderInfosBean.setLastOrderId(0);
			getBuyerOrderInfosBean.setLastOrderIdIsRealOrderId(true);
			List<Integer> orderStatusList = new ArrayList<Integer>();
			orderStatusList.add(OrderStatusEnum.AccountPaid.getValue());
			orderStatusList.add(OrderStatusEnum.ApplyForPostPay.getValue());
			orderStatusList.add(OrderStatusEnum.OrderEstablish.getValue());
			orderStatusList.add(OrderStatusEnum.SystemCancel.getValue());
			orderStatusList.add(OrderStatusEnum.Shipped.getValue());
			orderStatusList.add(OrderStatusEnum.SellerAcceptCancel.getValue());
			orderStatusList.add(OrderStatusEnum.SellerAccept.getValue());
			getBuyerOrderInfosBean.setOrderStatusList(orderStatusList);
			getBuyerOrderInfosBean
					.setRefundedOrderOnly(OrderRefundedTypeEnum.SalesRefund
							.getValue());
			getBuyerOrderInfosBean.setToBeEvaluatedDays(0);
			getBuyerOrderInfosV2Call.setData(getBuyerOrderInfosBean);
			getBuyerOrderInfosV2Call.callService();
			Logger.verifyEquals("400", getBuyerOrderInfosV2Call.getCode(),
					"验证code");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBuyerOrderInfosV2_005() {
		Logger.start(true, "获取买家订单列表, 必填字段+LastOrderId,查询成功");
		try {
			int UserId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			getBuyerOrderInfosBean.setBuyerId(UserId);
			getBuyerOrderInfosBean.setOrderNum(10);
			getBuyerOrderInfosBean.setLastOrderId(0);
			getBuyerOrderInfosV2Call.setData(getBuyerOrderInfosBean);
			getBuyerOrderInfosV2Call.callService();
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBuyerOrderInfosV2_006() {
		Logger.start(true, "获取买家订单列表, 必填字段+LastOrderIdIsRealOrderId,查询成功");
		try {
			int UserId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			getBuyerOrderInfosBean.setBuyerId(UserId);
			getBuyerOrderInfosBean.setOrderNum(10);
			getBuyerOrderInfosBean.setLastOrderIdIsRealOrderId(true);
			getBuyerOrderInfosV2Call.setData(getBuyerOrderInfosBean);
			getBuyerOrderInfosV2Call.callService();
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBuyerOrderInfosV2_007() {
		Logger.start(true, "获取买家订单列表, 必填字段+orderStatusList,查询成功");
		try {
			int UserId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			getBuyerOrderInfosBean.setBuyerId(UserId);
			getBuyerOrderInfosBean.setOrderNum(10);
			List<Integer> orderStatusList = new ArrayList<Integer>();
			orderStatusList.add(OrderStatusEnum.AccountPaid.getValue());
			orderStatusList.add(OrderStatusEnum.ApplyForPostPay.getValue());
			orderStatusList.add(OrderStatusEnum.OrderEstablish.getValue());
			orderStatusList.add(OrderStatusEnum.SystemCancel.getValue());
			orderStatusList.add(OrderStatusEnum.Shipped.getValue());
			orderStatusList.add(OrderStatusEnum.SellerAcceptCancel.getValue());
			orderStatusList.add(OrderStatusEnum.SellerAccept.getValue());
			getBuyerOrderInfosBean.setOrderStatusList(orderStatusList);
			getBuyerOrderInfosV2Call.setData(getBuyerOrderInfosBean);
			getBuyerOrderInfosV2Call.callService();
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBuyerOrderInfosV2_008() {
		Logger.start(true, "获取买家订单列表, 必填字段+RefundedOrderOnly,查询成功");
		try {
			int UserId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			getBuyerOrderInfosBean.setBuyerId(UserId);
			getBuyerOrderInfosBean.setOrderNum(10);
			getBuyerOrderInfosBean
					.setRefundedOrderOnly(OrderRefundedTypeEnum.SalesRefund
							.getValue());
			getBuyerOrderInfosV2Call.setData(getBuyerOrderInfosBean);
			getBuyerOrderInfosV2Call.callService();
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBuyerOrderInfosV2_009() {
		Logger.start(true, "获取买家订单列表, 必填字段+ToBeEvaluatedDays,查询成功");
		try {
			int UserId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			getBuyerOrderInfosBean.setBuyerId(UserId);
			getBuyerOrderInfosBean.setOrderNum(10);
			getBuyerOrderInfosBean.setToBeEvaluatedDays(0);
			getBuyerOrderInfosV2Call.setData(getBuyerOrderInfosBean);
			getBuyerOrderInfosV2Call.callService();
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBuyerOrderInfosV2_010() {
		Logger.start(true, "删除的订单不在列表范围内");
		try {
			Logger.comment("准备一个删除的订单");
			OrderCallService orderCallService = new OrderCallService();
			orderCallService.createM2cOrder();
			PlaceOrderResp placeOrderResp=new OrderCallService().createM2cOrder();

			int orderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int sellerId =placeOrderResp.getOrderList().get(0).getSellerId();
			int userId =placeOrderResp.getUserId();    
			orderCallService.salesMarkOrderDeleted(orderId, userId, true);
			Logger.comment("订单准备完成");

			getBuyerOrderInfosBean.setBuyerId(userId);
			getBuyerOrderInfosBean.setOrderNum(10);
			getBuyerOrderInfosBean.setToBeEvaluatedDays(0);
			getBuyerOrderInfosV2Call.setData(getBuyerOrderInfosBean);
			getBuyerOrderInfosV2Call.callService();
			DataUtil.verifyEquals(false, getBuyerOrderInfosV2Call
					.getBuyerOrderInfosResponseV2().getOrderInfos().stream()
					.anyMatch(a -> a.getOrderId() == orderId),
					"验证删除的订单不会出现在列表中");
			// verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	@Ignore
	/**
	 * 恢复删除的功能目前没有需求，不需要测试
	 */
	public void Tc_GetBuyerOrderInfosV2_011() {
		Logger.start(true, "恢复删除的订单需要返回给用户");
		try {
			Logger.comment("准备一个恢复删除的订单");
			OrderCallService orderCallService = new OrderCallService();
			orderCallService.createM2cOrder();
			PlaceOrderResp placeOrderResp=new OrderCallService().createM2cOrder();

			int orderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int sellerId =placeOrderResp.getOrderList().get(0).getSellerId();
			int userId =placeOrderResp.getUserId();    
			orderCallService.salesMarkOrderDeleted(orderId, userId, true);
			orderCallService.salesMarkOrderDeleted(orderId, userId, false);
			Logger.comment("订单准备完成");

			getBuyerOrderInfosBean.setBuyerId(userId);
			getBuyerOrderInfosBean.setOrderNum(10);
			getBuyerOrderInfosBean.setToBeEvaluatedDays(0);
			getBuyerOrderInfosV2Call.setData(getBuyerOrderInfosBean);
			getBuyerOrderInfosV2Call.callService();
			DataUtil.verifyEquals(true, getBuyerOrderInfosV2Call
					.getBuyerOrderInfosResponseV2().getOrderInfos().stream()
					.anyMatch(a -> a.getOrderId() == orderId),
					"验证删除的订单恢复后，会重新出现在列表中");
			// verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}